import React, { Component } from 'react'

export default class RefCom extends Component {
  //声明事件会回调
  send = () => {
    //获取文本框输入的内容
    let v = this.refs.input.value;
    //为 div 设置标签文本
    this.refs.div.innerHTML = v;
  }

  render() {
    return (
      <div>
        <input ref="input" type="text" /><button onClick={this.send}>发送</button>
        <hr />
        <div ref="div"   style={{
          width: 400,
          height: 300,
          border: 'solid 1px #234'
        }}></div>
      </div>
    )
  }
}
